<template>
  <div class="nav">
    <div class="query" v-for="(item, index) in dataInfo" :key="index">
      <div class="head">{{ index }}</div>
      <div class="head-line"></div>
      <ul>
        <li
          :class="index === Index ? 'active' : ''"
          @click="handleClickItem(i, index)"
          v-for="(i, index) in item"
          :key="i"
        >
          {{ i }}
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
import headerData from "@/data/headerData.js";
import { mapState, mapGetters, mapMutations } from "vuex";
export default {
  name: "Nav",
  props: {
    list: {
      default: () => {
        return {
          学院概况: [
            "学院介绍",
            "学院领导",
            "机构设置",
            "学院工作",
            "名师介绍",
          ],
        };
      },
    },
  },
  data() {
    return {
      clickIndex: 0,
    };
  },
  created() {},
  mounted() {},
  computed: {
    ...mapState({
      dataInfo: (state) => state.h_data,
      Index: (state) => state.clickIndex,
    }),
  },
  methods: {
    handleClickItem(i, index) {
      //   this.Index = index;
      this.$store.commit("SETINDEX", index);
    },
  },
};
</script>


<style lang="less" scoped>
.clearfix:after {
  visibility: hidden;
  display: block;
  font-size: 0;
  content: " ";
  clear: both;
  height: 0;
}
.nav {
  width: 250px;
  text-align: left;
  float: left;
  margin-top: 50px;
  li {
    text-indent: 25px;
    text-align: left;
    width: 100%;
    height: 55px;
    line-height: 55px;
    font-size: 16px;
    color: #323232;
    background: #eeeeee;
    border-bottom: 1px solid #c2c2c2;
  }
  .active {
    background: url("../../assets/images/left-menu-on1.png") left no-repeat,
      url("../../assets/images/left-menu-on2.png") right no-repeat;
  }

  .head {
    background: #084e96;
    height: 80px;
    line-height: 80px;
    font-size: 26px;
    text-indent: 20px;
    color: #fff;
  }
  .head-line {
    width: 60px;
    height: 1px;
    background: #fafafa;
    position: relative;
    top: -21px;
    left: 20px;
  }
}
</style>